export interface SearchItem {
  equipmentStateType?: string;
  projectIds?: Array<string>;
  searchText?: string;
  equipmentTypeId?: string;
}

export interface EquipmentItem {
  brandId: string;
  brandVo: {
    brandChineseName: string;
    brandCode: string;
    brandEnglishName: string;
    brandId: string;
    brandLogo: string;
  };
  equipmentInfo: {
    equipmentPhotoList: string[];
    nameplateInfoList: string[];
    manufacturer: string;
    additionalinfo: any;
    chargePerson: string;
    serialNumber: string;
    specification: string;
  };
  connectType: string;
  gatewayName: string;
  customerId: string;
  descriptions: string;
  equipmentGroupId: string;
  equipmentId: string;
  equipmentIdentifier: string;
  equipmentName: string;
  equipmentNo: string;
  equipmentPhotos: string[];
  equipmentTags: string;
  equipmentTypeId: string;
  gatewayId: string;
  gatewayTypeId: string;
  location: string;
  manufacturer: string;
  nameplateInfo: any[];
  projectId: string;
  remark: string;
  serialNumber: string;
  slaveId: number | null;
  specification: string;
  tenantId: string;
  useDate: string;
  equipmentTypeName: string;
  slavType: string;
  equipmentType: string;
  isOnline: number;
  faultNumber: number;
  chargePerson: string;
  chargePersonId: string;
  additionalinfo: string;
  projectName: string;
  equipmentOwner: string;
  connectTypeString: string;
  equipmentGroup: string;
  equipmentCategoryId: string;
  equipmentParamDto: {
    attributes: {
      controlParam: EqAttrGroupItem[];
      eventlParam: EqAttrGroupItem[];
      keyParam: EqAttrItem[];
      operationParam: EqAttrGroupItem[];
    };
  };
}
export type ParEquipmentDetail = Partial<EquipmentItem>;
export type EquipmentWithParam = Partial<EquipmentItem> & {
  paramName?: string;
  paramKey?: string;
  paramValue?: PropItem["value"];
  status?: EquipmentStatusItem["equipmentStatus"] | null;
};

export interface NameplateInfo {
  name: string;
  unit: string;
  value: string;
}
export interface EquipmentInfo {
  additionalinfo: string;
  equipmentInfoId: string;
  equipmentPhotos: string;
  manufacturer: string;
  equipmentOwner: string;
  specification: string;
  marking: string;
  nameplateInfo: string;
  nameplateInfos: Array<{
    name: string;
    unit: string;
    value: string;
  }>;
  transportType: string;
  equipmentPhotoList: Array<string>;
  nameplateInfoList: Array<string>;
}

export interface AddEquipmentReqItem {
  brandId: string;
  description: string;
  equipmentGroupId: string;
  equipmentInfo?: EquipmentInfo;
  equipmentName: string;
  equipmentNo: string;
  equipmentTags: string;
  equipmentTypeId: string;
  identification: string;
  location: string;
  projectId: string;
  remark: string;
}

export type GroupCode = "operating_param" | "control_param" | "key_param" | string;

export interface PropItem {
  value: number | string | boolean;
  type: "BOOLEAN" | "Int16" | "Float" | "String";
  desc: string;
  time: string;
  unit: string;
  display: boolean;
  groupCode: GroupCode;
  key?: string;
}

export interface ParamItem {
  name: string;
  key: string;
  value?: PropItem["value"];
  unit: string;
  display: boolean;
  type: PropItem["type"];
}

export interface EquipmentPropResult {
  dateTime: string;
  equipmentId: string;
  equipmentName: string;
  keys: {
    [key: string]: PropItem;
  };
}

export interface EqPropListResult {
  dateTime: string;
  equipmentCode: string;
  equipmentName: string;
  controlParam: PropItem[];
  keyParam: PropItem[];
  operatingParam: PropItem[];
}

export interface EquipmentStatusItem {
  equipmentId: string;
  equipmentStatus: "online" | "offline";
  equipmentFaultStatus: boolean;
}

export interface EquipmentTypeItem {
  createdBy: string;
  createdOn: string;
  descriptions: string;
  displayOrder: number;
  equipmentTypeCode: string;
  equipmentTypeId: string;
  defaultEquipmentCategoryId: string;
  equipmentTypeLevel: number;
  equipmentTypeName: string;
  equipmentTypePhoto: string;
  isActive: true;
  isDeleted: true;
  parentEquipmentTypeId: string;
  parentEquipmentTypeIds: string;
  remark: string;
  tenantId: string;
  updatedBy: string;
  updatedOn: string;
  equipmentCategoryId: string;
  defaultEquipmentTypePhoto: string;
  defaultEquipmentTypeName: string;
  defaultEquipmentTypeId: string;
}
export type ParEquipmentTypeItem = Partial<EquipmentTypeItem>;

export interface EquipmentGroupItem {
  equipmentGroupId: string;
  equipmentGroupName: string;
  projectId: string;
  tenantId: string;
}

export interface SearchGroupTypeItem {
  equipmentGroupId?: string;
  equipmentStateType?: string;
  equipmentTypeId?: string;
  projectId?: string;
  searchText?: string;
}

export interface EquipmentTypeListItem {
  equipmentNumber: number;
  equipmentTypeId: string;
  equipmentGroupName: string;
  equipmentGroupId: string;
  equipmentTypeLogo: string;
  equipmentTypeName: string;
  equipments?: EquipmentItem[];
}

export interface EquipmentGroupList<T> {
  equipmentsOfGroup: Array<T>;
  totalNumber: number;
}

export interface ServiceRecordItem {
  maintenanceContent: string;
  maintenanceType: string;
  maintenanceTypeDesc: string;
  nickName: string;
  phone: string;
  workOrderCode: string;
  workOrderId: string;
  workOrderType: string;
  workOrderTypeDesc: string;
}

export interface ServiceTypeCountItem {
  workOrderType: string;
  workOrderTypeDesc: string;
  workOrderTypeNumber: 0;
}

export interface EquipmentFunctionModalOptions {
  equipmentTypeId: string;
  equipmentTypeName: string;
  defaultEquipmentTypeId: string;
}

export interface GatewayModalPropsOptions {
  equipmentId?: string;
  equipmentTypeId?: string;
  equipmentName?: string;
  gatewayId: string;
  gatewayTypeId: string;
  equipmentAttributeId?: string;
}

export interface EqAttrItem {
  attributeId: string;
  attributeName: string;
  attributeValue: any;
  attributeValueString: string;
  dataType: string;
  display: boolean;
  displayOrder: number;
  equipmentAttributeId: string;
  time: string;
  unit: string;
}

export interface EqAttrGroupItem {
  title: string;
  attrList: EqAttrItem[];
}
export interface HealthInfo {
  radarValues: {
    max: number;
    name: string;
    value: number;
  }[];
  remainingLife: number;
  serviceLife: number;
}
